<?php
/*
	下单
	电商客生成订单后，会调用本方法，可在此执行一些下单后要执行的动作，例如生成插件里面的订单等
*/
defined('BY_JYA') or exit('error');
list($params)=$arguments;
$seckillinfo = $this->model('model')->getSeckill($params['goods_id']);
if(!$seckillinfo){
	return false;
}
$goods=array(
	'goodsid'=>$params['goods_id'],
	'optionid'=>$params['optionid'],
	'total'=>$params['num'],
);
$new_order_goods=array(
	'plugin_name'=>'jy_seckill',
	'isseckill'=>1,
	'seckill_taskid'=>$seckillinfo['taskid'],	
	'seckill_roomid'=>$seckillinfo['roomid'],	
	'seckill_timeid'=>$seckillinfo['timeid'],	
);
pdo_update('jy_weishop_order_goods',$new_order_goods,array('uniacid'=>$_SESSION['uniacid'],'mid'=>$params['mid'],'orderid'=>$params['order_id'],'goodsid'=>$params['goods_id'],'optionid'=>$params['optionid']));
$this->model('model')->setSeckill($seckillinfo,$goods,$params['mid'],$params['order_id'],0);